package avicit.bdp.oss.utils.upload.entity;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2020-12-09
 * @类说明：OssUploadDto
 * @修改记录：
 * @注意事项：
 * @主要功能：OSS断点/分片上传使用
 */
public class OssUploadDto extends UploadDto {
    /**
     * 桶名称
     */
    private String bucketName;

    /**
     * 前缀
     */
    private String prefix;

    /**
     * 对象名称
     */
    private String objectName;

    /**
     * 对象大小
     */
    private long objectSize;

    /**
     * 任务ID
     */
    private String taskId;

    public OssUploadDto() {
    }

    /**
     * 有参构造函数
     * @param builder
     */
    public OssUploadDto(UploadDtoBuilder builder) {
        super(builder);
    }

    /**
     * 有参构造函数
     * @param builder
     */
    public OssUploadDto(OssUploadDtoBuilder builder) {
        super(builder);

        this.bucketName = builder.bucketName;
        this.prefix = builder.prefix;
        this.objectName = builder.objectName;
        this.objectSize = builder.objectSize;
        this.taskId = builder.taskId;
    }

    public static OssUploadDtoBuilder builder() {
        return new OssUploadDtoBuilder();
    }

    public String getBucketName() {
        return bucketName;
    }

    public String getPrefix() {
        return prefix;
    }

    public String getObjectName() {
        return objectName;
    }

    public long getObjectSize() {
        return objectSize;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public void setObjectName(String objectName) {
        this.objectName = objectName;
    }

    public void setObjectSize(long objectSize) {
        this.objectSize = objectSize;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public static class OssUploadDtoBuilder extends UploadDtoBuilder<OssUploadDtoBuilder> {
        private String bucketName;
        private String prefix;
        private String objectName;
        private String taskId;
        private long objectSize;

        public OssUploadDtoBuilder bucketName(String bucketName) {
            this.bucketName = bucketName;
            return this;
        }

        public OssUploadDtoBuilder prefix(String prefix) {
            this.prefix = prefix;
            return this;
        }

        public OssUploadDtoBuilder objectName(String objectName) {
            this.objectName = objectName;
            return this;
        }

        public OssUploadDtoBuilder objectSize(long objectSize) {
            this.objectSize = objectSize;
            return this;
        }

        public OssUploadDtoBuilder taskId(String taskId) {
            this.taskId = taskId;
            return this;
        }

        public OssUploadDto build() {
            return new OssUploadDto(this);
        }
    }
}
